package com.fresh.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.fresh.entity.RejIn;
import com.fresh.entity.RejInQO;
import com.fresh.mapper.CiPinMapper;
import com.fresh.service.CiPinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CiPinServiceImpl implements CiPinService {
    @Autowired
    CiPinMapper ciPinMapper;

    @Override
    public PageInfo<RejIn> findPageInfoByCondition(RejInQO rejInQO, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<RejIn> rejIns = ciPinMapper.findPageInfoByCondition(rejInQO);
        PageInfo<RejIn> pageInfo = new PageInfo<>(rejIns);
        return pageInfo;
    }

    @Override
    public void add(RejIn rejIn) {
        ciPinMapper.insert(rejIn);
    }

}
